# ---------------------------------------------------------------------------
# Author: Keith Hill
# Desc:   Two utility functions to export and import command line history.
# Date:   Nov 18, 2006
# Site:   http://www.codeplex.com/PowerShellCX
# Usage:  In your profile place the following command:
#  
#         . "$Env:PscxHome\Profile\History.ps1"
# ---------------------------------------------------------------------------

Set-Alias ephy Export-History -Option AllScope -Description "PSCX function alias"
function Export-History([string]$path = "$Home\PSHistory.xml")
{
	Get-History -count $MaximumHistoryCount | Export-Clixml $path
}

set-alias iphy Import-History -Option AllScope -Description "PSCX function alias"
function Import-History([string]$path = "$Home\PSHistory.xml")
{
	Import-Clixml $path | Add-History
}

# Usage: Select-History (1..5+8,9+14..20)
function Select-History([int[]]$indices)
{
	$indices | foreach {(get-history -id $_).CommandLine}
}
